﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.YWGZ
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.YWGZ;

    public class wf_ywgz_Map : ClassMapping<wf_ywgz>
    {
        public wf_ywgz_Map()
        {
            Id(x => x.id, map =>
            {
                map.Length(40);
                map.Column(wf_ywgz.Columns.id);
            });
            Property(x => x.is_valid, map => map.Column(wf_ywgz.Columns.is_valid));
            Property(x => x.create_date, map => map.Column(wf_ywgz.Columns.create_date));
            Property(x => x.gz_bz, map => map.Length(10000));
            Property(x => x.gz_fs, map => map.Length(10000));
            Property(x => x.gz_lx, map => map.Length(10000));
            Property(x => x.gz_ms, map => map.Length(10000));

            //所属项目
            ManyToOne(x => x.project, map =>
            {
                map.Column(wf_ywgz.Columns.gz_proj_id);
                map.NotNullable(false);
            });

            Table(wf_ywgz.TableName);

            //不进行创建
            SchemaAction(NHibernate.Mapping.ByCode.SchemaAction.None);
        }
    }
}
